#ifndef __SEGMENT_HPP__
#define __SEGMENT_HPP__

#include "Engine/Vector2.hpp"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{
    struct Segment2
    {
        Vector2 start;
        Vector2 end;

        constexpr Segment2(const Vector2& theStart, const Vector2& theEnd);

        static float Distance(const Segment2 &s, const Vector2 &p);
        static Vector2 NearestPoint(const Segment2 &s, const Vector2 &p);
    };

    constexpr Segment2::Segment2(const Vector2& theStart, const Vector2& theEnd) : start(theStart), end(theEnd) {}
    
} // namespace PocketSurvival


#endif
